<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>MYSHOP 管理中心 - 添加分类</title>
  <meta name="robots" content="noindex, nofollow">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <css file="__PUBLIC__/Admin/css/general.css" />
  <css file="__PUBLIC__/Admin/css/main.css" />
  <script type="text/javascript" src='__PUBLIC__/Admin/Js/jquery-1.8.3.min.js'></script>
  <script type="text/javascript" src="__PUBLIC__/Admin/js/transport.js"></script>
  <script type="text/javascript" src="__PUBLIC__/Admin/js/common.js"></script>

  <script type='text/javascript'>
  $(function () {
    $('#sub').click(function () {
      if ($('select[name=tid]').val() == '') {
        alert('请选择所属类型');
        return false;
      };
    });
  });
</script>
</head>
<body>

  <h1>
    <span class="action-span">
      <a href="{:U('Category/index')}">商品分类</a>
    </span>
    <span class="action-span1">
      <a href="">MYSHOP 管理中心</a>
    </span>
    <span id="search_id" class="action-span1">- 添加分类</span>
    <div style="clear:both"></div>
  </h1>
  <!-- start add new category form -->
  <div class="main-div">
    <form action="{:U(runAddCate)}" method="post" name="theForm" enctype="multipart/form-data" onsubmit="return validate()">
      <table width="100%" id="general-table">
        <tr>
          <td class="label">分类名称:</td>
          <td>
            <input type='text' name='name' maxlength="20" value='' size='27' /> 
            <font color="red">*</font>
          </td>
        </tr>
        <tr>
          <td class="label">上级分类:</td>
          <td>
            <select name="pid">
              <option value="0">顶级分类</option>
              <foreach name='cate' item='v'>
                <if condition='$v["id"] eq $pid'>
                  <option value="{$v.id}" selected="selected">{$v.html}{$v.name}</option>
                <else/>
                  <option value="{$v.id}">{$v.html}{$v.name}</option>
                </if>
              </foreach>
            </select>
          </td>
        </tr>
        <tr>
          <td class="label">所属类型:</td>
          <td>
            <select name="tid">
              <option value="">请选择商品类型</option>
              <foreach name='type' item='v'>
                <option value="{$v.id}">{$v.name}</option>
              </foreach>
            </select>
          </td>
        </tr>

      </table>
      <div class="button-div">
        <input type="submit" value=" 确定 " id='sub' />
        <input type="reset" value=" 重置 " />
      </div>
    </form>
  </div>
  <script type="text/javascript" src="__PUBLIC__/Admin/js/utils.js"></script>
  <script type="text/javascript" src="__PUBLIC__/Admin/js/validator.js"></script>
</body>
</html>